<h2><?php echo $this->title; ?></h2>
<hr />
<div class="list">   
    <ul>
        <li>
            <?php echo $this->book->Title; ?> 
            <ul>
                <li>                        
                    <?php echo $this->book->Creationdate?>   
                </li>
                <li>Description:                       
                    <?php echo $this->book->Description?>   
                </li>
                <li>Chapters    
                    <ul>
                        <?php foreach($this->book->Chapters as $chapters) {?>                            
                            <?php foreach($chapters->Chapters as $chapter) {?>
                                    <a href="<?php echo $this->baseUrl(); ?>/book/viewchapter/id/<?php echo $this->book->Id ?>/id2/<?php echo $chapter->Id ?>">
                                        <?php echo $chapter->Name?>  
                                    </a>
                                    <?php if($this->Role->Name == 'Admin' || $this->Role->Name == 'Senior') {?>    
                                    <a href="<?php echo $this->baseUrl(); ?>/chapter/edit/id/<?php echo $chapter->id ?>"><img src="<?php echo $this->baseUrl(); ?>/styles/assets/edit.png" /></a>
                                    <?php } ?>
                                    <ul>
                                        <?php foreach($chapter->Articles as $article) {?>
                                            <?php if($article->Chapterid == $this->chapterId) {?>
                                                <li>
                                                    <a href="<?php echo $this->baseUrl(); ?>/book/viewarticle/id/<?php echo $this->book->Id ?>/id2/<?php echo $chapter->Id ?>/id3/<?php echo $article->Articles->Id ?>">
                                                        <?php echo $article->Articles->Name;?>   
                                                    </a>               
                                                    <?php if($this->Role->Name == 'Admin' || $this->Role->Name == 'Senior') {?>    
                                                    <a href="<?php echo $this->baseUrl(); ?>/article/edit/id/<?php echo $article->id ?>"><img src="<?php echo $this->baseUrl(); ?>/styles/assets/edit.png" /></a>
                                                    <?php } ?>
                                                </li>                                                
                                                <?php if($article->Articles->Id == $this->articleId) {?>
                                                <li>
                                                        <?php echo $article->Articles->Text;?>   
                                                </li>                                                
                                                <?php } ?> 
                                            <?php } ?>
                                               
                                        <?php } ?>
                                    </ul>
                            <?php } ?>
                        <?php } ?>
                    </ul>                    
                </li>
            </ul>
        </li> 
    </ul>
</div>
<hr />